package com.etb.wisdom.eframe.framework.service.impl;

import org.springframework.stereotype.Service;

import com.etb.core.service.ETBService;
import com.etb.core.utils.SequenceUtil;
import com.etb.wisdom.eframe.framework.service.AppFunctionService;
import com.etb.wisdom.eframe.model.AppFuncgroup;
import com.etb.wisdom.eframe.model.AppFunction;

@Service
public class AppFunctionServiceImpl extends ETBService implements AppFunctionService {

	@Override
	public void save(AppFunction function) {
		service.save(function);
		AppFuncgroup group = new AppFuncgroup();
		group.setId(function.getGroupid());
		service.extend(group);
		function.setFuncseq(SequenceUtil.generateNewSequence(group.getFuncgroupseq(), function.getId()));
		service.save(function);
	}
}
